package com.xcity.pomelo.response;

import com.xcity.db.entity.Build;

import naga.x.net.impl.pomelo.PomeloMessage;
import naga.x.net.impl.pomelo.protocol.Message;

@PomeloMessage(type = Message.Type.RESPONSE)
public class AttackBuildResponse extends Response {

	protected byte result; // 战斗结果(0:失败, 1:胜利)
	protected int gold; // 获得现金
	protected long pid; // 目标玩家id
	protected int bid; // 目标建筑id
	protected byte status;
	protected int restCD;
	
	public AttackBuildResponse(int serial, byte result, int gold, Build build) {
		super(serial);
		this.result = result;
		this.gold = gold;
		this.pid = build.getManager().getOwner().getId();
		this.bid = build.getId();
		this.status = build.getState().codeOfOldVersion();
		this.restCD = build.getLeftRestCD();
	}

	public byte getResult() {
		return result;
	}

	public void setResult(byte result) {
		this.result = result;
	}

	public int getGold() {
		return gold;
	}

	public void setGold(int gold) {
		this.gold = gold;
	}

	public long getPid() {
		return pid;
	}

	public void setPid(long pid) {
		this.pid = pid;
	}

	public int getBid() {
		return bid;
	}

	public void setBid(int bid) {
		this.bid = bid;
	}

	public byte getStatus() {
		return status;
	}

	public void setStatus(byte status) {
		this.status = status;
	}

	public int getRestCD() {
		return restCD;
	}

	public void setRestCD(int restCD) {
		this.restCD = restCD;
	}

}
